﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HF.Architecture.Data;
using HF.WorkFlow.DataContract;
using HF.WCF.WFInterface;
using System.Data;
namespace HF.WCF.WFService
{
   public  class ArchitectureService:IArchitectureService
    {
        public List<ArchitectureEntity> GetAllDepartmentEntitys()
        {
            return ArchitectureData.GetInstance().GetAllDepartmentEntitys();
        }

        public List<WorkFlow.DataContract.UserEntity> GetUserEntitys(string architectureId)
        {
            return ArchitectureData.GetInstance().GetUserEntitys(architectureId);
        }


        public List<ArchitectureEntity> GetDepartmentEntitysOfUser(string userId)
        {
            return ArchitectureData.GetInstance().GetDepartmentEntitysOfUser(userId);
        }

        public List<ArchitectureEntity> GetChildArchitectureEntitys(string architectureId)
        {
            return ArchitectureData.GetInstance().GetChildArchitectureEntitys(architectureId);
        }

        public List<ArchitectureEntity> GetChildDepartmentEntitys(string architectureId)
        {
            return ArchitectureData.GetInstance().GetChildDepartmentEntitys(architectureId);
        }

        public List<ArchitectureEntity> GetDutyEntitys(string architectureId)
        {
            return ArchitectureData.GetInstance().GetDutyEntitys(architectureId);
        }

        public List<ArchitectureEntity> GetLeaderEntitys(string architectureId)
        {
            return ArchitectureData.GetInstance().GetLeaderEntitys(architectureId);
        }

        public string GetFatherId(string architectureId)
        {
            return ArchitectureData.GetInstance().GetFatherId(architectureId);
        }

        public void MoveUserIntoArchitecture(string userId, string architectureId)
        {
            ArchitectureData.GetInstance().MoveUserIntoArchitecture(userId, architectureId);
        }

        public void RemoveAllArchitectures(string userId)
        {
            ArchitectureData.GetInstance().RemoveAllArchitectures(userId);
        }

        public void RemoveUser(string userId, string architectureId)
        {
            ArchitectureData.GetInstance().RemoveUser(userId, architectureId);
        }

        public void RemoveAllUsers(string architectureId)
        {
            ArchitectureData.GetInstance().RemoveAllUsers(architectureId);
        }

        public List<ArchitectureEntity> GetHighDepartmentEntitysOfUser(string userId)
        {
           return ArchitectureData.GetInstance().GetHighDepartmentEntitysOfUser(userId);
        }

        public List<ArchitectureEntity> GetLowerDepartmentEntitysOfUser(string userId)
        {
            return ArchitectureData.GetInstance().GetLowerDepartmentEntitysOfUser(userId);
        }


        public bool Exists(string architectureId)
        {
            return ArchitectureData.GetInstance().Exists(architectureId);
        }

        public ArchitectureEntity GetArchitectureEntity(string architectureId)
        {
            return ArchitectureData.GetInstance().GetArchitectureEntity(architectureId) ;
        }

        public int Insert(ArchitectureEntity entity)
        {
            return ArchitectureData.GetInstance().Insert(entity);
        }

        public int Update(ArchitectureEntity entity)
        {
            return ArchitectureData.GetInstance().Update(entity);
        }

        public int Delete(string architectureId)
        {
            return   ArchitectureData.GetInstance().Delete(architectureId);
        }

        public DataTable GetArchitecturesOfUser(string userId)    // 获取用户的岗位   zhuyun
        {
            return ArchitectureData.GetInstance().GetArchitecturesOfUser(userId);
        }
       

    }
}
